package cc.rengu.igas.bomp.common.enums;

/**
 * Created by zhangxuran on 2020/04/22
 */
public enum RegisterTypeEnum {
    ENTERPRISE("01", "企业"),
    INDIVIDUAL("02", "个体"),
    BRANCH("03", "分支机构"),
    NON_ENTER_ARTIF("04", "非企业法人"),
    ;
    private String registerType;
    private String registerDesc;

    RegisterTypeEnum(String registerType, String registerDesc) {
        this.registerType = registerType;
        this.registerDesc = registerDesc;
    }

    public String getRegisterType() {
        return registerType;
    }

    public void setRegisterType(String registerType) {
        this.registerType = registerType;
    }

    public String getRegisterDesc() {
        return registerDesc;
    }

    public void setRegisterDesc(String registerDesc) {
        this.registerDesc = registerDesc;
    }

    /*
     * 根据注册类型查询注册类型描述
     * @param registerType 注册类型
     * return registerDesc 注册描述
     * */
    public static String getDescByType(String registerType) {
        for (RegisterTypeEnum registerTypeEnum : RegisterTypeEnum.values()) {
            if (registerTypeEnum.getRegisterType().equals(registerType)) {
                return registerTypeEnum.getRegisterDesc();
            }
        }
        return null;
    }
}
